Apple II
File Type Notes
_____________________________________________________________________________
                                                  Developer Technical Support


File Type:         $1A (26)
Auxiliary Type:    All

Full Name:     AppleWorks Word Processor File
Short Name:    AppleWorks WP File

Revised by:    Bob Lissner                                      November 1988
Written by:    Bob Lissner                                      February 1984

Files of this type and auxiliary type contain an AppleWorks(TM) Word Processor 
file.
_____________________________________________________________________________

Files of type $1A and any auxiliary type contain an AppleWorks Word Processor 
file.  AppleWorks is now published by CLARIS.  For information on AppleWorks, 
contact CLARIS at:

                    CLARIS
                    440 Clyde Avenue
                    Mountain View, CA 94043

                    Technical Information
                    Telephone:  (415) 962-0371
                    AppleLink:  Claris.Tech

                    Non-Technical Information
                    Telephone:  (415) 962-8946
                    AppleLink:  Claris.CR

In addition to the support available from CLARIS, Bob Lissner, the author of 
AppleWorks, maintains a bulletin board for AppleWorks-related information.  
You can obtain technical information and file formats from this system as well 
as submit your comments in writing.  You can reach this system at (702) 831-
1722.


Definitions

The following definitions apply to AppleWorks files in addition to those 
defined for all Apple II file types:

    MRL    Data base multiple record layout
    SRL    Data base single record layout
    RAC    Review/Add/Change screen
    DB     AppleWorks or /// E-Z Pieces Data Base
    SS     AppleWorks or /// E-Z Pieces Spreadsheet
    WP     AppleWorks or /// E-Z Pieces Word Processor
    AW     AppleWorks or /// E-Z Pieces


Auxiliary Type Definitions

The volume or subdirectory auxiliary type word for this file type is defined 
to control uppercase and lowercase display of filenames.  The highest bit of 
the least significant byte corresponds to the first character of the filename, 
the next highest bit of the least significant byte corresponds to the second 
character, etc., through the second bit of the most significant byte, which 
corresponds to the fifteenth character of the filename.

AppleWorks performs the following steps when it saves a file to disk:

1.    Zeros all 16 bits of the auxiliary type word.
2.    Examines the filename for lowercase letters.  If one is found, it 
      changes the corresponding bit in the auxiliary type word to 1 and 
      changes the letter to uppercase.
3.    Examines the filename for spaces.  If one is found, it changes the 
      corresponding bit in the auxiliary type word to 1 and changes the 
      space to a period.

When files are read from disk, the filename and auxiliary type information 
from the directory file entry are used to determine which characters should be 
lowercase and which periods should be displayed as spaces.  If you use the 
auxiliary type bytes for a different purpose, AppleWorks will still display 
the filenames, but the wrong letters are likely lowercase.


Word Processor Files

Word Processor files start with a 300 byte header, followed by a number of 
variable length line records, one for each line on the screen.

Header Record

The header contains the following information:

+000 to +003                Not used.
+004               Byte     $4F (79)
+005 to +084       Bytes    Tab stops.  Either equal sign (=) or 
                            vertical bar (|).
+085               Byte     Boolean:  Zoom switch.
+086 to +089                Four bytes not used.
+090               Byte     Boolean:  Whether file is currently 
                            paginated (i.e., whether the page break 
                            lines are displayed).
+091               Byte     Minimum left margin that should be added 
                            to the margin that is appearing on the 
                            screen.  This is normally one inch, shown 
                            in 10ths of an inch, 10 or $0A.
+092               Byte     Boolean:  Whether file contains any mail-
                            merge commands.
+093 to +249       Bytes    Not used.  Reserved for mail merge.
+250 to +299       Bytes    Available.  Will never be used by 
                            AppleWorks.  If you are creating this type 
                            of file, you can use this area to keep 
                            information that is important to your 
                            program.

Line Records

Line records are of three different types.  The first line record after the 
300 byte header corresponds to line 1, the next is line 2, and so on.  The 
first two bytes of each line record contain enough information to establish 
the type.

Carriage Return Line Records

Carriage return line records have a $D0 (208) in byte +001.  Byte +000 is a 
one byte integer between 00 and 79 that is the horizontal screen position of 
this carriage return.

Command Line Records

Command line records are formatting commands that appear on the screen in the 
form:

--------Double Space

for example.  These records can be identified by a value greater than $D0 
(208) in byte +001. They are:

     Byte +001    Command           Byte +000
     $D8          Platen width      Byte    10ths of an inch
     $D9          Left margin       Byte    10ths of an inch
     $DA          Right margin      Byte    10ths of an inch
     $DB          Chars per inch    Byte
     $DC          Proportional-1            No meaning
     $DD          Proportional-2
     $DE          Indent            Byte    Characters
     $DF          Justify
     $E0          Unjustify
     $E1          Center
     $E2          Paper length      Byte    10ths of an inch
     $E3          Top margin        Byte    10ths of an inch
     $E4          Bottom margin     Byte    10ths of an inch
     $E5          Lines per inch    Byte
     $E6          Single space
     $E7          Double space
     $E8          Triple space
     $E9          New page
     $EA          Group begin
     $EB          Group end
     $EC          Page header
     $ED          Page footer
     $EE          Skip lines        Byte    Count
     $EF          Page number       Byte
     $F0          Pause each page
     $F1          Pause here
     $F2          Set marker        Byte    Marker number
     $F3          Page number       Byte    (add 256)
     $F4          Page break        Byte    Page number
     $F5          Page break        Byte    (add 256)
     $F6          Page break        Byte    (break in middle of paragraph)
     $F7          Page break        Byte    (add 256 in middle of paragraph)
     $FF          End of file


Text Records

Text records are the lines where text has been typed.  The format is:

+000 to +001       Word     Number of bytes following this word.  
                            Since the maximum is about 80, byte +001 
                            is always zero.  Use byte +001 to identify 
                            text lines.
+002                        Screen column for the first text 
                            character.  Usually will be zero, but may 
                            vary as a result of left margin, 
                            centering, and indent commands.
+003               Byte     If bit 7 (the high bit) of this byte is 
                            on, there is a carriage return on the end 
                            of this line.  If off, no carriage return.
                            Bits 6-0:  Number of bytes of text 
                            following this byte.
+004 to nnn                 Actual text bytes.  Consists of ASCII 
                            characters and special codes.  The special 
                            codes are values from $01 to $1F, and 
                            indicate special formatting features:

                                 Code   Meaning
                                 $01    Begin boldface
                                 $02    Boldface end
                                 $03    Superscript begin
                                 $04    Superscript end
                                 $05    Subscript begin
                                 $06    Subscript end
                                 $07    Underline begin
                                 $08    Underline end
                                 $09    Print page number
                                 $0A    Enter keyboard
                                 $0B    Sticky space
                                 $0C    Mail merge

